package com.xposed.aliproxy.thread;

import android.content.Context;

import com.xposed.aliproxy.qrcode.GlobalInstance;
import com.xposed.aliproxy.socket.SocketManager;
import com.xposed.aliproxy.utils.XposeUtil;

import java.util.ArrayList;
import de.robv.android.xposed.XposedBridge;

/* renamed from: h.f */
public class SocketWriteThread extends Thread {
    /* renamed from: a */
    public boolean f1800a = false;
    /* renamed from: b */
    public boolean f1801b = false;
    /* renamed from: c */
    private Context f1802c;
    /* renamed from: d */
    private SocketManager f1803d;
    /* renamed from: e */
    private ArrayList<String> f1804e = new ArrayList();

    public SocketWriteThread(Context context) {
        this.f1802c = context;
    }

    public void run() {
        super.run();
        this.f1801b = true;
        while (!GlobalInstance.getInstance().f1764c && !this.f1800a) {
            this.f1803d = SocketManager.m2947a(this.f1802c);
            try {
                Thread.sleep(300);
                ArrayList arrayList = GlobalInstance.getInstance().stringArrayList;
                for (int i = 0; i < arrayList.size(); i++) {
                    String str = (String) arrayList.get(i);
                    arrayList.remove(str);
                    str = XposeUtil.m3000b(str);
                    if (str != null) {
                        this.f1803d.mo3617a(str);
                    }
                }
            } catch (Throwable th) {
                XposedBridge.log(th);
                SocketManager.m2950b();
            }
        }
    }
}
